/**
 * @file 测试插件
 * @author its-wild(https://gitee.com/its-wild)
 * @date 2021/08/02
 */
 (function () {
    'use strict';
    // 1.获取 tinymce 的插件管理对象
    var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
    // 2.注册命令
    var register = function (editor) {
      editor.addCommand('doTest', function () {
        editor.execCommand('mceInsertContent', false, '<hr />');
      });
    };
    // 3.注册按钮和菜单栏
    var register$1 = function (editor) {
      editor.ui.registry.addButton('test', {
        icon: 'test',
        tooltip: 'Horizontal line',
        onAction: function () {
          return editor.execCommand('doTest');
        }
      });
      editor.ui.registry.addMenuItem('test', {
        icon: 'test',
        text: 'Horizontal line',
        onAction: function () {
          return editor.execCommand('doTest');
        }
      });
    };
    // 4.添加插件到
    function Plugin () {
      global.add('test', function (editor) {
        register(editor);
        register$1(editor);
      });
    }

    Plugin();

}());
